No such container path · Issue #106 · markshust/docker | 您所在的位置:网站首页 › no such container › No such container path · Issue #106 · markshust/docker |
Container: Magento-2 OS: Mac OS High Sierra Shell: zsh and bash Running ./bin/start command with a fresh terminal instance is giving me issues with startup on occasion. ~/code/fundamentals-of-magento-dev> ./bin/start Starting fundamentals-of-magento-dev_db_1 ... done Starting fundamentals-of-magento-dev_phpfpm_1 ... done Starting fundamentals-of-magento-dev_app_1 ... done Initiating bi-directional sync between host & containers... Error: No such container:path: magento-dev_phpfpm_1:/var/www/html/app Error: No such container:path: magento-dev_phpfpm_1:/var/www/html/bin Error: No such container:path: magento-dev_phpfpm_1:/var/www/html/dev Error: No such container:path: magento-dev_phpfpm_1:/var/www/html/generated Error: No such container:path: magento-dev_phpfpm_1:/var/www/html/lib Error: No such container:path: magento-dev_phpfpm_1:/var/www/html/phpserver Error: No such container:path: magento-dev_phpfpm_1:/var/www/html/pub Error: No such container:path: magento-dev_phpfpm_1:/var/www/html/setup Error: No such container:path: magento-dev_phpfpm_1:/var/www/html/update Error: No such container:path: magento-dev_phpfpm_1:/var/www/html/var Error: No such container:path: magento-dev_phpfpm_1:/var/www/html/vendor All containers have started successfully.It looks like grep isn't grabbing the full path of my docker containers. Instead of pulling fundamentals-of-magento-dev_phpfpm_1, it is starting at magento-dev_phpfpm_1. I'm not a grep ninja, but here's what I've done to the /bin/copydir/ script to fix it. I've changed this line: docker cp $(docker-compose ps|grep phpfpm|awk '{print $1}'):/var/www/html/$1 src/ to: docker cp $(echo ${PWD##*/}_phpfpm_1|awk '{print $1}'):/var/www/html/$1 src/ This seems to fix the issue for each attempt when I open a fresh terminal window. I wonder if this is due to my long folder names? My solution makes a few assumptions: The container is using the default naming convention of CURRENT-DIRECTORY_container-name_#. The phpfpm container that I want is the ONLY phpfpm container running, therefore I can hardcode the number.I feel that this is a hacky solution, but does anyone with more grep experience know a quick fix for this? If this works I'd be happy to create a PR or investigate further into grep. Probably wouldn't be a bad thing to learn 😄 |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |